package test10;

import com.tyfspring.context.support.ClassPathXmlApplicationContext;
import org.junit.Test;

/**
 * @Description TODO
 * @Author shallow
 * @Date 2023/4/12 20:19
 */

public class test {
    @Test
    public void test(){
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:test10/spring.xml");
        applicationContext.registerShutdownHook();

        UserService userService1 = applicationContext.getBean("userService", UserService.class);
        UserService userService2 = applicationContext.getBean("userService", UserService.class);

        System.out.println("userService1 = " + userService1.toString());
        System.out.println("userService2 = " + userService2.toString());
        System.out.println(userService1.getUserDao());
        System.out.println(userService2.getUserDao());
        System.out.println(userService1.queryUserInfo());
        System.out.println(userService1+"十六进制哈希:"+Integer.toHexString(userService1.hashCode()));}
}
